package com.sixth.stock.controller;

import com.sixth.core.entity.News;
import com.sixth.core.vo.R;
import com.sixth.stock.mapper.NewsMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/stock/news")
public class NewsController {
    @Resource
    private NewsMapper newsMapper;
    @GetMapping("/getNewsByNewsId/{newsId}")
    public R<News> getNewsByNewsId(@PathVariable String newsId){
        return R.ok(newsMapper.selectById(newsId));
    }

}
